<?php
include_once(SYSTEM.'/Model.php');
include_once(SYSTEM.'/StringLengthRule.php');
include_once(SYSTEM.'/RequiredRule.php');

class LoginModel extends Model
{
	public $Email;
	public $Password;
	public $Captcha;

	public function __construct($params)
	{									
		$this->Email = $params['email'];
		$this->Password = $params['password'];
		
		$this->AddRules('Email', new RequiredRule('Email k duoc de trong'));
		$this->AddRules('Password', new RequiredRule('Password k duoc de trong'));
		if(isset($params['captcha'])) 
		{
			$this->AddRules('Captcha', new RequiredRule('Captcha k duoc de trong'));
			$this->Captcha = $params['captcha'];
		}
	}
}